<template>
    <div class="app">
        <h4>父组件 -- <button @click="getComponentObject">获取组件实例</button></h4>
        <BaseForm ref="baseForm"></BaseForm>
        <button @click="handelGet">获取数据</button>
        <button @click="handelReset">重置数据</button>
    </div>
</template>

<script>
import BaseForm from './components/BaseForm.vue'
export default {
    components: {
        BaseForm,
    },
    methods: {
        getComponentObject() {
            console.log(this.$refs.baseForm);
        },
        handelGet() {
            console.log(this.$refs.baseForm.getFormData());
        },
        handelReset() {
            this.$refs.baseForm.resetFormData()
        }
    }
}
</script>

<style></style>